package com.levy.contronller.jvm.classLoader;

/**
 * Created by levy on 2019/6/14.
 */
public class MyTest24 implements Runnable{

    private Thread thread;

    public MyTest24() {
        thread = new Thread(this);
        thread.start();
    }

    @Override
    public void run() {
        ClassLoader tClassLoader =this.thread.getContextClassLoader();
        System.out.println(tClassLoader);

        ClassLoader classLoader = this.getClass().getClassLoader();
        System.out.println(classLoader);

        this.thread.setContextClassLoader(classLoader);

        System.out.println("class: "+ classLoader.getClass());
        System.out.println("parent: " +classLoader.getParent().getClass());
    }


    public static void main(String[] args) {
        new MyTest24();
    }
}
